package sei.excel.reader;

import com.alibaba.excel.EasyExcel;
import sei.cloud.datacache.DataCacheService;
import org.springframework.stereotype.Component;
import sei.cloud.common.support.ResMsg;
import sei.cloud.datasource.sqldb.DataService;

import javax.annotation.Resource;

@Component
public class ExcelReader {
    @Resource
    DataService dataService;
    @Resource
    DataCacheService dataCacheService;

    public void exportToDB(String filePath, int headRows){
        ResMsg resMsg =new ResMsg();
        EasyExcel.read(filePath,new NoModelDataListener(dataService, dataCacheService,resMsg)).sheet().headRowNumber(headRows).doRead();
    }

}
